Method, device, and system for allocating address in ip network

ABSTRACT

A method for allocating an address in an IP network includes: receiving, by a server, a request message from a client, where the client is connected to the server through at least one routing device, and the request message received by the server carries a device identifier of a preceding stage routing device of the client; obtaining, by the server, according to the device identifier of the preceding stage routing device, a first address prefix pool that is pre-allocated to the preceding stage routing device, and allocating a second address prefix pool to the client according to the first address prefix pool, where an address range corresponding to the second address prefix pool falls within an address range corresponding to the first address prefix pool; and sending, by the server, the second address prefix pool to the client.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2011/075233, filed on Jun. 3, 2011, which claims priority toChinese Patent Application No. 201010526872.3, filed on Oct. 21, 2010,both of which are hereby incorporated by reference in their entireties.

FIELD OF THE INVENTION

The embodiments of the present invention relate to communicationstechnologies, and in particular, to a method, a device, and a system forallocating an address in an IP network.

BACKGROUND OF THE INVENTION

Versions of the Internet Protocol (Internet Protocol, referred to as IP)may be classified into two types: IPv4 and IPv6. An IPv4 address prefixpool is allocated by using a dynamic host configuration protocol(Dynamic Host Configuration Protocol, referred to as DHCP). A routingdevice between a client (client) and a DHCP server (DHCP server) mayapply to a preceding stage (a DHCP server or a preceding stage routingdevice) for an IPv4 address prefix pool stage by stage, and thenallocates the IPv4 address prefix pool to a following stage (a followingstage routing device or a client) stage by stage. An IPv6 address prefixpool is allocated by using an IPV6 dynamic host configuration protocol(Dynamic Host Configuration Protocol for IPv6, referred to as DHCPv6). Arouting device between a client (client) and a DHCPv6 server (DHCPv6server) may apply to a preceding stage (a DHCPv6 server or a precedingstage routing device) for an IPv6 address prefix pool stage by stage,and then allocates the IPv6 address prefix pool to a following stage (afollowing stage routing device or a client) stage by stage.

Each routing device between a client and a DHCP server/DHCPv6 serverneeds to be configured with configuration information for allocating anaddress prefix pool to a following stage routing device or the client.Because of different configuration information, complexity of aconfiguration operation is increased and efficiency of improving addressallocation is decreased.

SUMMARY OF THE INVENTION

Embodiments of the present invention provide a method, a device, and asystem for allocating an address in an IP network, so as to decreasecomplexity of a configuration operation and improve efficiency ofallocating an address.

An embodiment of the present invention provides a method for allocatingan address in an IP network, which includes:

receiving, by a server, a request message from a client, where theclient is connected to the server through at least one routing device,and the request message received by the server carries a deviceidentifier of a preceding stage routing device of the client;

obtaining, by the server, according to the device identifier of thepreceding stage routing device, a first address prefix pool that ispre-allocated to the preceding stage routing device, allocating a secondaddress prefix pool to the client according to the first address prefixpool, where an address range corresponding to the second address prefixpool falls within an address range corresponding to the first addressprefix pool; and

sending, by the server, the second address prefix pool to the client.

An embodiment of the present invention further provides a device forallocating an address in an IP network. The device for allocating anaddress is connected to a client through at least one routing device,and the device for allocating an address includes:

an interface module, configured to receive a request message from aclient, where the request message carries a device identifier of apreceding stage routing device of the client, and send a second addressprefix pool to the client, where the second address prefix pool isallocated by an address allocating module to the client; and

the address allocating module, configured to obtain, according to thedevice identifier of the preceding stage routing device, a first addressprefix pool that is pre-allocated to the preceding stage routing device,and allocate the second address prefix pool to the client according tothe first address prefix pool, where an address range corresponding tothe second address prefix pool falls within an address rangecorresponding to the first address prefix pool.

An embodiment of the present invention further provides a system forallocating an address in an IP network. The system for allocating anaddress includes a server, at least one routing device, and a client,where the server is connected to the client through the at least onerouting device, and

the server is configured to receive a request message from the client,where the request message carries a device identifier of a precedingstage routing device of the client, obtain, according to the deviceidentifier of the preceding stage routing device, a first address prefixpool that is pre-allocated to the preceding stage routing device,allocate a second address prefix pool to the client according to thefirst address prefix pool, where an address range corresponding to thesecond address prefix pool falls within an address range correspondingto the first address prefix pool, and send the second address prefixpool to the client.

In embodiments of the present invention, a server pre-allocates a firstaddress prefix pool to a preceding stage routing device of a client, sothat a second address prefix pool may be allocated to the clientaccording to the first address prefix pool. Configuration informationonly needs to be configured on the server in a unified manner and doesnot need to be configured on corresponding routing devices respectively,thus decreasing complexity of a configuration operation, so thatefficiency of allocating an address is improved.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention or in the prior art more clearly, the accompanying drawingsrequired for describing the embodiments or the prior art are introducedbriefly in the following. Apparently, the accompanying drawings in thefollowing description are only some embodiments of the presentinvention, and persons of ordinary skill in the art may also deriveother drawings from these accompanying drawings without creativeefforts.

FIG. 1 is a diagram of a network architecture on which an embodiment ofthe present invention is based;

FIG. 2 is a schematic diagram of a procedure of a method for allocatingan address in an IP network according to an embodiment of the presentinvention;

FIG. 3 is a diagram of a network architecture on which an embodiment ofthe present invention is based;

FIG. 4 is a schematic structural diagram of a device for allocating anaddress in an IP network according to an embodiment of the presentinvention; and

FIG. 5 is a schematic structural diagram of a system for allocating anaddress in an IP network according to an embodiment of the presentinvention.

DETAILED DESCRIPTION OF THE EMBODIMENTS

In order to make the objectives, technical solutions, and advantages ofthe embodiments of the present invention clearer, the technicalsolutions in the embodiments of the present invention are clearly andcompletely described in the following with reference to the accompanyingdrawings in the embodiments of the present invention. Apparently, theembodiments in the following description are merely a part rather thanall of the embodiments of the present invention. Based on theembodiments of the present invention, all other embodiments obtained bypersons of ordinary skill in the art without creative efforts shall fallwithin the protection scope of the present invention.

In an IP network, a server may be connected to one or multiple clientsthrough one stage or multiple stages of routing devices. As shown inFIG. 1, the server here may be a DHCP server or an access node controlprotocol (Access Node Control Protocol, ANCP) server. A DHCP server cansupport the DHCPv4 protocol or DHCPv6 protocol. If the server is an ANCPserver, the ANCP server may also be connected with the DHCP server, sothat address prefix pool information may be obtained from the DHCPserver. The routing device here may be an intermediary device such as arouter or a switch.

Based on the preceding architecture, an embodiment of the presentinvention provides a method for allocating an address in an IP network,as shown in FIG. 2, which includes:

Step 200: A server receives a request message from a client, where theclient is connected to the server through one stage of or multiplestages of routing devices.

The request message in this embodiment may be a DHCP request message,and may also be a self-defined message.

Step 202: The server queries and obtains a first address prefix pool ofa routing device that is connected with the client, and allocates asecond address prefix pool to the client according to the first addressprefix pool, where the first address prefix pool may include multipleaddress prefixes, and the second address prefix pool may include atleast one address prefix.

In this embodiment, the server needs to pre-allocate, according to anaddress prefix pool configuration policy, the first address prefix tothe routing device that is connected with the client, and the addressprefix pool configuration policy here may be a specific rule about howto allocate an address prefix pool, such as a configuration policy basedon a topology of network devices that are administrated by or attachedto the server, where the network devices that are administrated by orattached to the server may include a routing device and/or a terminaldevice. In an embodiment shown in FIG. 1, a server 10 maintains anetwork topology of administrated or attached network devices, allocatesa first address prefix pool to a routing device 12 according to aconnection relationship between the routing device 12 and clients 14 and16, where the first address prefix pool may include two address pools,and sends the first address prefix pool to the routing device 12, sothat the routing device 12 performs route aggregation by using the firstaddress prefix pool, for example, adds the first address prefix pool toa local routing table so as to implement route aggregation.

In an embodiment shown in FIG. 3, multiple stages of routing devices areconnected between a server and a client. A routing device 30 may beserved as a client of a routing device 12 and initiates a requestmessage to a server 10 through the routing device 12 to request theserver 10 to allocate an address prefix pool to the routing device 30. Afirst address prefix pool has been already allocated to the routingdevice 12 on the server 10. When the request message for requesting anaddress prefix pool is received, where the request message is initiatedby the routing device 30, a second address prefix pool is allocated tothe routing device 30 according to the first address prefix pool that isallocated to the routing device 12, where content included by the secondaddress prefix pool falls within a range of the first address prefixpool, so as to ensure route aggregation. Similarly, routing devices 32and 34 initiate request messages for requesting address prefix pools tothe server 10 through the routing devices 30 and 12. The server mayallocate address prefix pools to the routing devices 32 and 34 accordingto the address prefix pool that is allocated to the routing device 30.

Based on FIG. 3, for example, an IPv6 address prefix pool of eachrouting device in FIG. 3 may be allocated as follows.

The server 10 may allocate, according to a network topology of networkdevices that are administrated by or attached to the server 10, anaddress prefix pool respectively corresponding to each network device inthe network topology. A description of network location identifierinformation of a network device is recorded in network topologyinformation that is used for describing the network topology.

In an embodiment of the present invention, a preceding stage routingdevice that is connected with a client receives a request message forrequesting an address prefix pool, where the request message isinitiated by the client to a server. The request message includes aclient identifier. The preceding stage routing device adds a deviceidentifier of the preceding stage routing device into the requestmessage and sends the request message to the server. In addition toadding the device identifier of the preceding stage routing device intothe request message, the preceding stage routing device may further adda connection identifier of a connection between the client and thepreceding stage routing device, such as a port identifier of a port onthe preceding stage routing device for being connected with the clientor a line identifier of a line between a preceding stage router and theclient. The server queries a local record according to a deviceidentifier of a routing device in a received request message, andallocates a second address prefix pool to the client according to afirst address prefix pool that is allocated to a routing devicecorresponding to the device identifier of the routing device in thelocal record. The server also associates the second address prefix poolwith the client, for example, records a table of mapping relationshipsamong a second address prefix pool, network location information of aclient, and a client identifier, as shown in Table 1.

TABLE 1 Identifier of Connection Device Identifier between Client ofPreceding and Preceding Serial Stage Routing First Address Stage RoutingClient Second Address Number Device Prefix Pool Device (Optional)Identifier Prefix Pool 1 Routing device 2001:1000::/32 Routing2001:1000:1000::/48 12 device 30 2 Routing device 2001:1000:1000::/48Routing 2001:1000:1000:1200::/56 30 device 32 3 Routing device2001:1000:1000::/48 Routing 30 device 34

Specifically, a server 10 maintains an overall IPv6 address prefix pooland allocates a 32-bit IPv6 address prefix pool 2001:1000::/32 to arouting device 12.

A client on a routing device 30 initiates a request message forrequesting an IPv6 address prefix pool through the routing device 12,where the request message carries a client identifier.

The routing device 12 captures the request message, adds a deviceidentifier of the routing device 12 and a connection identifier of aconnection between the routing device 12 and the routing device 30 intothe request message, and sends the request message including additionalinformation to the server 10. The server 10 receives the request messagefor requesting an IPv6 address prefix pool, and allocates, according tothe device identifier of the routing device 12 in the request message, a48-bit IPv6 address prefix pool 2001:1000:1000::/48 to the routingdevice 30 from an address prefix pool 2001:1000::/32 that is allocatedto the routing device 12. The server 10 sends the allocated IPv6 addressprefix pool 2001:1000:1000::/48 to the routing device 30, associatesinformation in the request message with the IPv6 address prefix pool2001:1000:1000::/48 that is allocated to the routing device 30, andmakes a record in Table 1, for example, creates a record 1 if Table 1has no record before, and records the device identifier of the routingdevice 12 in an entry of the Device Identifier of Preceding StageRouting Device of the record 1, records an address prefix pool of therouting device 12 in an entry of the First Address Prefix Pool, recordsthe device identifier of the routing device 30 in an entry of the ClientIdentifier, records an address prefix pool of the routing device 30 inan entry of the Second Address Prefix Pool, and optionally, may furtherrecord the connection identifier of the connection between the routingdevice 30 and the routing device 12 in an entry of the Identifier ofConnection between

Client and Preceding Stage Routing Device.

Similarly, when a client on a routing device 32 initiates a requestmessage for requesting an IPv6 address prefix pool, the server 10 adoptsthe same method to allocate, according to a device identifier of arouting device 20, where the device identifier of the routing device 20is carried in the request message, a 56-bit IPv6 address prefix pool2001:1000:1000:1200::/56 to the routing device 32 from the addressprefix pool 2001:1000:1000::/48 that is allocated to the routing device30. The server 10 sends the allocated IPv6 address prefix pool2001:1000:1000:1200::/56 to the routing device 32, and associatesinformation in the request message with the IPv6 address prefix pool2001:1000:1000:1200::/56 that is allocated to the routing device 32, forexample, creating a record 2 in Table 1. An address prefix pool of arouting device is obtained by extending the length of an address prefixpool of a preceding stage routing device to which the routing device isconnected.

Step 204: Each network device receives an address prefix pool that isallocated by the server, adds the address prefix pool into a localrouting table, so as to implement route aggregation.

In this embodiment of the present invention, if the first address prefixpool allocated by the server 10 to the preceding stage routing device(such as the routing device 32 in FIG. 3) of the client is insufficient,the server 10 may allocate a new first address prefix pool (the newfirst address prefix pool is another address prefix pool, namely, athird address prefix pool) to the preceding stage routing device, andallocates a second address prefix pool to the client according to thenew first address prefix pool. The server 10 sends the new first addressprefix pool to the preceding stage routing device, and sends the secondaddress prefix pool to the client. In addition, after obtaining the newfirst address prefix pool allocated by the server 10, the precedingstage routing device also adds the new first address prefix pool intothe routing table, so as to further implement completely staticaggregation of routing.

In this embodiment, the first address prefix is pre-allocated to thepreceding stage routing device of the client, so that the second addressprefix pool may be allocated to the client according to pre-configuredconfiguration information and the first address prefix pool that ispre-allocated to the preceding stage routing device of the client.Configuration information only needs to be configured on the server in aunified manner and does not need to be configured on correspondingrouting devices respectively, thus decreasing complexity of aconfiguration operation, so that efficiency of allocating an address isimproved.

An embodiment of the present invention provides a device for allocatingan address. The provided device for allocating an address may be a DHCPserver, a DHCPv6 server, or an ANCP sever, and as shown in FIG. 4,includes an interface module 40 and an address allocating module 42.

The interface module 40 is configured to receive a request message froma client, where the request message carries a device identifier of apreceding stage routing device of the client, and send a second addressprefix pool to the client, where the second address prefix pool isallocated by the address allocating module 42 to the client.

The address allocating module 42 is configured to obtain, according tothe device identifier of the preceding stage routing device, a firstaddress prefix pool that is pre-allocated to the preceding stage routingdevice, and allocate the second address prefix pool to the clientaccording to the first address prefix pool, where an address rangecorresponding to the second address prefix pool falls within an addressrange corresponding to the first address prefix pool.

The request message from the client further carries a client identifierof the client, and the address allocating module 42 is furtherconfigured to associate the client identifier with the second addressprefix pool.

The address allocating module 42 is further configured to, afterreceiving the request message, determine that the first address prefixpool of the preceding stage routing device of the client isinsufficient, allocate a new first address prefix pool (the new firstaddress prefix pool is another address prefix pool, namely, a thirdaddress prefix pool) to the preceding stage routing device, allocate asecond address prefix pool to the client according to the new firstaddress prefix pool, and send the new first address prefix pool to thepreceding stage routing device.

The interface module 40 is further configured to send the first addressprefix pool to the preceding stage routing device.

In this embodiment, the first address prefix is pre-allocated to thepreceding stage routing device of the client, so that the second addressprefix pool may be allocated to the client according to pre-configuredconfiguration information and the first address prefix pool that ispre-allocated to the preceding stage routing device of the client.Configuration information only needs to be configured on the device forallocating an address in a unified manner and does not need to beconfigured on corresponding routing devices respectively, thusdecreasing complexity of a configuration operation, so that efficiencyof allocating an address is improved.

An embodiment of the present invention provides a system for allocatingan address. The provided system may be used in an IP network, and asshown in FIG. 5, includes a server 50, a routing device 52, and a client54. The client 54 is connected with the server 50 through the routingdevice 52.

The server 50 is configured to receive a request message from the client54, where the request message carries a device identifier of a precedingstage routing device (the routing device 52 in FIG. 5 in thisembodiment) of the client 54, obtain, according to the device identifierof the preceding stage routing device, a first address prefix pool thatis pre-allocated to the preceding stage routing device, allocate asecond address prefix pool to the client 54 according to the firstaddress prefix pool, where an address range corresponding to the secondaddress prefix pool falls within an address range corresponding to thefirst address prefix pool, and send the second address prefix pool tothe client.

The routing device 52 is configured to forward a message between theclient 54 and the server 50, pre-send a request message for requestingallocation of a first address prefix pool to the server 50 after beingpowered on, and save the first address prefix pool in a local routingtable after receiving the first address prefix pool.

The server 50 may, after receiving the request message of the routingdevice 52, allocate a first address prefix pool to the routing device 52based on a preset configuration policy, where the configuration policymay be based on a network topology of network devices that areadministrated by or attached to the server 50, and after allocating thefirst address prefix pool to the routing device 52, send the firstaddress prefix pool to the routing device 52 through a response message.

The server 50 may also allocate the first address prefix pool to therouting device 52 after receiving a request message of the client 54,allocate the second address prefix pool to the client 54 according tothe first address prefix pool, and through the routing device 52, send aresponse message including the first address prefix pool and the secondaddress prefix pool to the client 54. After receiving the responsemessage, the routing device 52 saves the first address prefix poollocally, for example, saves the first address prefix pool in a localrouting table.

Multiple routing devices may be connected between the client 54 andserver 50 in this embodiment.

In the system for allocating an address provided in this embodiment, anaddress prefix pool is pre-allocated to a preceding stage routing deviceof a client, the allocated address prefix pool is sent to a routingdevice to be saved locally, and after receiving a request of the client,a part is separated from the address prefix pool of the preceding stagerouting device for the client, so that each relay routing table is morestable, and aggregation network routes are less.

Persons of ordinary skill in the art may understand that all or a partof the steps of the preceding method embodiments may be implemented by aprogram instructing relevant hardware. The program may be stored in acomputer readable storage medium. When the program runs, the steps ofthe preceding method embodiments are executed. The storage medium mayinclude any medium that is capable of storing program codes, such as anROM, an RAM, a magnetic disk, or an optical disk.

Finally, it should be noted that the preceding embodiments are merelyprovided for describing the technical solutions of the presentinvention, but are not intended to limit the present invention. Itshould be understood by persons of ordinary skill in the art thatalthough the present invention has been described in detail withreference to the preceding embodiments, modifications may still be madeto the technical solutions described in the preceding embodiments, orequivalent replacements may be made to some technical features in thetechnical solutions, however, these modifications or replacements do notmake the essence of corresponding technical solutions depart from thespirit and scope of the technical solutions in the embodiments thepresent invention.

1. A method for allocating an address in an IP network, comprising:receiving, by a server, a request message from a client, wherein theclient is connected to the server through at least one routing device,and the request message received by the server carries a deviceidentifier of a preceding stage routing device; obtaining, by theserver, according to the device identifier of the preceding stagerouting device, a first address prefix pool that is pre-allocated to thepreceding stage routing device, allocating a second address prefix poolto the client according to the first address prefix pool, wherein anaddress range corresponding to the second address prefix pool fallswithin an address range corresponding to the first address prefix pool;and sending, by the server, the second address prefix pool to theclient.
 2. The method according to claim 1, wherein correspondingrelationships among a device identifier of a routing device, a firstaddress prefix pool, a client identifier, and a second address prefixpool are saved on the server; and the server queries, according to thedevice identifier of the preceding stage routing device, where thedevice identifier of the preceding stage routing device is carried inthe request message, the corresponding relationships to obtain the firstaddress prefix pool of the preceding stage routing device, allocates thesecond address prefix pool to the client according to the first addressprefix pool of the preceding stage routing device, and associates aclient identifier carried in the request message with the second addressprefix pool.
 3. The method according to claim 1, wherein after receivingthe request message, the server determines that the first address prefixpool of the preceding stage routing device of the client isinsufficient, allocates a new first address prefix pool to the precedingstage routing device, allocates a second address prefix pool to theclient according to the new first address prefix pool, and sends the newfirst address prefix pool to the preceding stage routing device.
 4. Themethod according to claim 2, wherein after receiving the requestmessage, the server determines that the first address prefix pool of thepreceding stage routing device of the client is insufficient, allocatesa new first address prefix pool to the preceding stage routing device,allocates a second address prefix pool to the client according to thenew first address prefix pool, and sends the new first address prefixpool to the preceding stage routing device.
 5. A device for allocatingan address in an IP network, wherein the device for allocating anaddress is connected to a client through at least one routing device,and the device for allocating an address comprises: an interface module,configured to receive a request message from the client, wherein therequest message carries a device identifier of a preceding stage routingdevice, and send a second address prefix pool to the client, wherein thesecond address prefix pool is allocated by an address allocating moduleto the client; and the address allocating module, configured to obtain,according to the device identifier of the preceding stage routingdevice, a first address prefix pool that is pre-allocated to thepreceding stage routing device, and allocate the second address prefixpool to the client according to the first address prefix pool, whereinan address range corresponding to the second address prefix pool fallswithin an address range corresponding to the first address prefix pool.6. The device according to claim 5, wherein the request message furthercarries a client identifier of the client, and the address allocatingmodule is further configured to associate the client identifier with thesecond address prefix pool.
 7. The device according to claim 5, whereinthe address allocating module is further configured to, after receivingthe request message, determine that the first address prefix pool of thepreceding stage routing device of the client is insufficient, allocate anew first address prefix pool to the preceding stage routing device,allocate a second address prefix pool to the client according to the newfirst address prefix pool, and send the new first address prefix pool tothe preceding stage routing device.
 8. The device according to claim 6,wherein the address allocating module is further configured to, afterreceiving the request message, determine that the first address prefixpool of the preceding stage routing device of the client isinsufficient, allocate a new first address prefix pool to the precedingstage routing device, allocate a second address prefix pool to theclient according to the new first address prefix pool, and send the newfirst address prefix pool to the preceding stage routing device.
 9. Asystem for allocating an address in an IP network, comprising a serverconnected to a client through at least one routing device, andconfigured to receive a request message from the client, wherein therequest message carries a device identifier of a preceding stage routingdevice of the client, obtain, according to the device identifier of thepreceding stage routing device, a first address prefix pool that ispre-allocated to the preceding stage routing device, allocate a secondaddress prefix pool to the client according to the first address prefixpool, wherein an address range corresponding to the second addressprefix pool falls within an address range corresponding to the firstaddress prefix pool, and send the second address prefix pool to theclient.
 10. The system according to claim 9, wherein the routing deviceis configured to pre-send a request message for requesting allocation ofa first address prefix pool to the server after being powered on, andsave the first address prefix pool in a local routing table afterreceiving the first address prefix pool.